<div id="product-list"> 
  <h1>Listing products</h1> 
  <table cellpadding="5" cellspacing="0"> 
    <% for admin_product in @products %> 
    <tr valign="top" class="<%= cycle('list-line-odd', 'list-line-even') %>"> 
    <td> 
      <%= image_tag admin_product.image_url, :class => 'list-image' %> 
    </td> 
    <td width="60%"> 
      <span class="list-title"><%=h admin_product.title %></span><br /> 
      <%=h truncate(admin_product.description.gsub(/<.*?>/,''), 80) %> 
    </td> 
    <td class="list-actions"> 
      <%= link_to 'Show', :controller => "admin/products", :action => "show", :id => admin_product.id %><br/> 
      <%= link_to 'Edit', edit_admin_product_path(admin_product) %><br/> 
      <%= link_to 'Destroy', {:controller => "admin/products", :action => :destroy, :id => admin_product.id}, 
        :confirm => 'Are you sure?', 
        :method => :delete %> <br />
      <%= link_to 'generate barcode', {:action => :barcode, :id => admin_product.id} %>
      </td> 
    </tr> 
    <% end %> 
  </table> 
</div> 
<br /> 
<%= link_to 'New product', new_admin_product_path %> 
